<?php
/** @var Page $this */

use Action\Common\Template;
use Model\Page;

/** @var Template self */
/** @var $_get_template_info */
if($_get_template_info)
    return [
        'name' => '微信推广(专业版)',
        'key' => $this->fns->filename(__FILE__),
        'desc' => '空的微信推广页面，自行填充内容',
        'fields' => [
            'wechats' => [
                'label' => '微信客服',
                'type' => Page::PT_LIST,
                'children_params' => [
                    'type' =>  Page::PT_OBJECT,
                    'nodes' => [
                        'num' => [
                            'label' => '微信号',
                            'type' => Page::PT_TEXT
                        ],

                        'nickname' => [
                            'label' => '昵称',
                            'type' => Page::PT_TEXT
                        ],
                    ]
                ],
            ],
            
            'top_tip' => [
                'label' => '顶部广告词',
                'type' => Page::PT_TEXT
            ],
            
            'content' => [
                'label' => '自定义内容',
                'type' => Page::PT_RICHTEXT,
                'style' => 'height:400px;'
            ],
            
            'comment_enabled' => [
                'label' => '是否启用评论',
                'type' => Page::PT_SWITCH,
                'default' => 0,
                'on_text' => '开启',
                'off_text' => '关闭'
            ],
            
            'comments' => [
                'label' => '评论内容',
                'type' => Page::PT_LIST,
                'children_params' => [
                    'type' => Page::PT_OBJECT,
                    'nodes' => [
                        'name' => [
                            'label' => '昵称',
                            'type' => Page::PT_TEXT
                        ],
                        
                        'content' => [
                            'label' => '评论内容',
                            'type' => Page::PT_RICHTEXT,
                            'style' => 'height:100px;'
                        ],
                        
                        'reply' => [
                            'label' => '回复',
                            'type' => Page::PT_LIST,
                            'children_params' => [
                                'type' => Page::PT_OBJECT,
                                'nodes' => [
                                    'name' => [
                                        'label' => '昵称',
                                        'type' => Page::PT_TEXT
                                    ],

                                    'content' => [
                                        'label' => '评论内容',
                                        'type' => Page::PT_RICHTEXT,
                                        'style' => 'height:100px;'
                                    ]
                                ]
                            ]
                            
                        ]
                    ]    
                ]
            ],
            
            'company_name' => [
                'label' => '公司名称',
                'type' => Page::PT_TEXT
            ]
        ]
    ];

?>

<?php
/** @var Template $this */
/** @var array $data */
/** @var array $templateData */

$v = $templateData['ver'];
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">


    <meta name="apple-mobile-web-app-status-bar-style" content="black">


    <link href="/static/pageres/wechat-web/common-1.css" tppabs="http://wx.boshidon.com/wap/css/common.css" rel="stylesheet"
          type="text/css">
    <link href="/static/pageres/wechat-web/common_1.css" tppabs="http://wx.boshidon.com/wap/css/common_1.css" rel="stylesheet"
          type="text/css">
    <link rel="shortcut icon" type="image/x-icon"
          href="http://res.wx.xn--vuqz89a.com/mmbizwap/zh_CN/htmledition/images/icon/common/favicon22c41b.ico">
    <link rel="stylesheet" type="text/css" href="/static/pageres/wechat-web/style.css"
          tppabs="http://wx.boshidon.com/wap/skin/xiake/css/style.css">
    <link href="/static/pageres/wechat-web/common-2.css" tppabs="http://wx.boshidon.com/wap/skin/css/common.css" rel="stylesheet"
          type="text/css">
    <link href="/static/pageres/wechat-web/index-1.css" tppabs="http://wx.boshidon.com/wap/skin/css/index.css" rel="stylesheet"
          type="text/css">
    <link rel="stylesheet" type="text/css" href="/static/pageres/wechat-web/page_mp_article_improve_combo2c9cd6.css"
          tppabs="http://wx.boshidon.com/wap/css/page_mp_article_improve_combo2c9cd6.css">

    <title><?php echo $data['title'] ?></title>

    <meta name="keywords" content="微信加人软件,微信自动加人软件,微信加人软件下载,微信加好友软件">
    <meta name="description" content="微商之家软件唯一官方网站。软件突破加人限制，可日加3000人，实现全自动化微信群发消息、点赞评论等一系列营销功能。">


    <link rel="stylesheet" type="text/css" href="/static/pageres/wechat-web/page_mp_article_improve2c9cd6.css"
          tppabs="http://wx.boshidon.com/wap/css/page_mp_article_improve2c9cd6.css">
    
    <style>
        .white_content {
            display: none;
            position: fixed;

            top: 50%;
            margin-left: -100px;
            left: 50%;
            margin-top: -60px;

            width: 200px;
            height: 100px;
            padding: 0px;

            background-color: #FFF;
            border-radius: 10px;
            z-index: 10001;
            overflow: auto;
        }

        .jieshou {
            position: absolute;
            left: 100px;
            top: 60px;
            width: 99px;
            height: 38px;
            text-align: center;
            background-color: #FFF;
            font-size: 18px;
            line-height: 35px;

            border-left: #CCC solid 1px;
            border-right: #CCC solid 0px;
            border-top: #CCC solid 2px;
            border-bottom: #CCC solid 0px;
            padding: 0px;
            border-radius: 0 0 10px 0;
            z-index: 10002;
            overflow: auto;
        }

        .shaohou {
            position: absolute;
            left: 0px;
            top: 60px;
            width: 99px;
            height: 38px;
            line-height: 35px;
            text-align: center;
            font-size: 18px;
            border-left: #CCC solid 0px;
            border-right: #CCC solid 1px;
            border-top: #CCC solid 2px;
            border-bottom: #CCC solid 0px;
            background-color: #FFF;
            padding: 0px;
            border-radius: 0 0 0 10px;
            z-index: 10002;
            overflow: auto;
        }

        .wrap_16 {
            position: fixed;
            left: 0;
            bottom: 0;
            width: 100%;
            z-index: 9999999;
        }

        .wrap_16_box {
            height: 70px;
            line-height: 30px;
            background: #000;
            opacity: 0.8;
            margin: 0 auto;
            min-width: 320px;
            max-width: 768px;
            font-size: 120%;
            text-align: center;
            color: #fff;
            padding: 5px 0;
        }


        /*右侧悬浮菜单*/
        .slide {
            width: 50px;
            height: 50px;
            position: fixed;
            top: 50%;
            margin-top: -10%;
            right: 30px;
            border-radius: 5px 0 0 5px;
            z-index: 999;
        }

        .tel {
            position: fixed;
            right: 0;
            top: 50%;
            margin-top: -42px;
            z-index: 99999;
        }

        .tel img {
            width: 55px;
        }

    </style>

    <style>
        .banquan {
            color:gray;
            text-align: center;
            margin-bottom: 50px;
            padding: 10px;
        }
        #bottom {
            width: 100%;
            position: fixed;
            bottom: 0px;
            height: 50px;
            margin: 0 auto;
            max-width: 640px;
            left: 0px;
            right: 0px;
        }

        #bottom p span {
            float: left;
            font-size: 12px;
            line-height: 25px;
            color: #fff;
            margin-left: 8px;
            font-weight: bold;
        }

        #bottom p b {
            font-size: 20px;
            float: left;
            height: 60px;
            margin-left: 8px;
            background: #fff;
            color: #0085FF;
            height: 30px;
            margin-top: 10px;
            padding: 0px 10px;
            border-radius: 5px;
        }

        #bottom .b_mian {
            max-width: 620px;
            width: 100%;
            margin: 0 auto;
            background: #0085FF
        }

        #bottom .b_mian #btn {
            float: right;
            margin-right: 5%;
            height: 40px;
            width: 100px;
            margin-top: 5px;
            cursor: pointer
        }

        #tophead {
            max-width: 640px;
            width: 100%;
            margin: 0 auto;
        }

        #tophead .nav ul li {
            background: #0085FF;
            width: 33.3%;
            float: left;
            line-height: 200%;
            text-align: center;
        }

        #tophead .nav ul li a {
            color: #fff;
        }

        .hide-wx {
            width: 320px;
            height: 288px;
            position: fixed;
            background: #fff;
            left: 50%;
            margin-left: -160px;
            top: 50%;
            margin-top: -180px;
            border-radius: 15px;
            border: 1px solid #ccc;
        }

        .wx1 {
            position: relative;
        }

        .close {
            position: absolute;
            right: 10px;
            top: -10px;
        }

        .wx1 p {
            margin-left: 2px;
            margin-top: 18px;
            font-size: 22px;
        }

        .wx2 {
            background-color: #f00;
            color: #ff0;
            font-weight: 600;
            text-align: center;
            font-size: 30px;
            padding: 2px
        }

        .wx2 a {
            text-decoration: none;
            color: #fff
        }

        .wx3 {
            text-align: center;
            padding: 10px;
            height: 67px;
            line-height: 67px;
        }

        /*.s1 { background-color: #f00; color: #ff0; font-weight: 600; text-align: center; font-size: 30px; padding: 2px }*/
        .wx3 a {
            color: #f00;
            list-style-type: none;
            text-decoration: none;
        }

        .sho2 {
            ccolor: #fff;
            background: #f00;
            height: 58px;
            line-height: 58px;
            text-align: center;
            font-size: 28px;
        }

        .sho3 {
            color: #f00;
            height: 58px;
            line-height: 58px;
            text-align: center;
            font-size: 22px;
        }

        .sho3 a {
            color: #f00;
        }

        .footer1 {
            position: fixed;
            height: 48px;
            bottom: 0;
            background: #302825;
            color: #fff;
            text-align: center;
            line-height: 48px;
            font-size: 16px;
            font-weight: 600;
            width: 100%
        }

        .zmtWechat {
            width: 100%;
            max-width: 640px;
            height: 40px;
            position: fixed;
            bottom: 0px;
        }

        .wechatIcon {
            width: 30px;
            vertical-align: middle;
        }

        .center {
            text-align: center;
        }
        .reply {
            margin-left:30px;
        }
    </style>
    <link rel="stylesheet" type="text/css" href="/static/pageres/wechat-web/main.css">
    <script type="text/javascript" src="/static/pageres/wechat-web/jquery.js?=<?php echo $v ?>"></script>
    <?php echo $data['head_html'] ?>
</head>

<body style="">
    <script>
        <?php if(empty($data['fields']['wechats'])): ?>
        var wechatMap = {
            'kfd599': '小新',
            'coast-1995': '小莫',
            'wmp6021': '路飞'
        };
        <?php else: ?>
        
        <?php 
            $wechats = [];
            foreach((array)$data['fields']['wechats'] as $row) {
                $wechats [$row['num']] = $row['nickname'];
            }
        ?>
        var wechatMap = <?php echo json_encode($wechats) ?>;
        <?php endif; ?>
    
        var wechats = Object.keys(wechatMap);
    
        var phoneNumber = '';
    
        var companyName = "";
    
        function random(min, max) {
            return Math.floor(Math.random() * (max - min)) + min;
        }
    
        var wechatIndex = random(0, wechats.length);
    
        function html(str) {
            document.write(str);
        }
    
        function writeWechatNo() {
            html(wechats[wechatIndex]);
        }
    
        function writeWechatName() {
            html(wechatMap[wechats[wechatIndex]]);
        }
    
    
    </script>
    <style>
        .container {
            display: flex;
            flex-wrap: wrap;
            padding: 15px 5px 0 5px;
        }
    
        .container > div.icon.text-center {
            padding-bottom: 15px;
        }
        
        .page-content img {
            width:100%;
        }
    </style>
    
    <div id="web" data-role="page">
        <div id="header" style="padding-top:67px;"></div>
        <div class="top_tip" style="background:#0085FF;box-shadow:5px 5px 5px #ccc;">
            <div style="padding: 0 20px; padding-bottom: 5px; margin:0 auto;display: flex;justify-content: center;">
                <div class="to_pc"><img width="60" src="/static/pageres/wechat-web/wx.gif?=<?php echo $v ?>" /></div>
                <div style="font-size:16px;line-height:160%; color:#fff;padding-top:5px;padding-bottom:5px; ">
                    <div>
                        添加微信:
                        <b id="No1" class="wx_account" style="color: yellow;border-radius:5px;padding:2px; font-size:21px; ">
                            <span name="weixin" id="article"><script>writeWechatNo()</script></span>
                            <img src="/static/pageres/wechat-web/2.png?=<?php echo $v ?>" id="copy" data-agl-cvt="35" width="100" style="margin-left:10px;">
                        </b>
                    </div>
                    <div>
                        <span style="font-size:14px;"><?php echo $data['fields']['top_tip'] ?></span> 
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="page-content">
        <?php echo $data['fields']['content'] ?>
    </div>

    <?php if($data['fields']['comment_enabled']): ?>
    <section class="96wx-bgc"
             style="white-space: normal; padding: 12px 15px; border-width: 0px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-color: rgb(207, 210, 136); color: rgb(255, 255, 255); min-height: 1em; text-align: justify; background-color: rgb(0, 187, 236);">
        <section style="border-color: rgb(0, 187, 236); color: inherit;">
            <p style="border-color: rgb(0, 187, 236); color: inherit; text-align: center;">
                <span style="font-size: 18px;"><strong>用户评价</strong></span>
            </p>
        </section>
    </section>
    <article class="detaillist">
        <?php foreach((array)$data['fields']['comments'] as $i => $comment): ?>
        <div class="detail">
            <div class="title"> <a class="bc" href="javascript:void(0);"><?php echo $comment['name'] ?></a><span class="fr "><?php echo $i+1 ?>楼</span> </div>
            <div class="content_box">
                <div class="content wap_content">
                    <p><?php echo $comment['content'] ?></p>
                </div>
                <small class="fl" id="today"></small> <span class="fr"><a class="fl quotereply" href="javascript:void(0);"><i
                                class="icon huifu"></i>回复</a></span>
                <div class="clear"></div>
            </div>
            
            <div class="reply">
                <?php foreach ((array)$comment['reply'] as $replyIndex => $reply): ?>
                <div class="detail">
                    <div class="title"> <a class="bc" href="javascript:void(0);"><?php echo $reply['name'] ?></a><span class="fr "></span> </div>
                    <div class="content_box">
                        <div class="content wap_content">
                            <p><?php echo $reply['content'] ?></p>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
        <?php endforeach; ?>
    </article>
    <?php endif; ?>
    
    <div class="bg"></div>
    <div class="hide-wx" id="showbox" style="display:none">
        <div class="wx1">
            <p class="showSize center mbottom15">1、长按<b>微信号复制</b></p>
            <div class="sho2" style=" color:#FF0;"><a href="">
                    <script>writeWechatNo()</script>
                </a></div>
            <a href="">
            </a>
            <p class="center"><a href=""></a><img=""
                src="index_files/timg.png?=<?php echo $v ?>" tppabs="http://nuanse.66ya.cn" id="" width="120"></a></p>
            <p class="center mbottom15" style="line-height:30px;">2、点击<b>“打开微信”</b></p>
            <div class="sho3 center mbottom15" style="margin-bottom: 15px"><a href="weixin://"
                                                                              onclick="PIWI_SUBMIT.Weixin_Open()">打开微信</a>
            </div>
            <div class="close" id="closebox"><img src="/static/pageres/wechat-web/TB2LvJEXtqgF1JjSsppXXaBNXXa-2145885388.png?=<?php echo $v ?>"
                                                  tppabs="http://zf.ryouq.cn/index/TB2LvJEXtqgF1JjSsppXXaBNXXa-2145885388.png"
                                                  alt=""></div>
        </div>
    </div>
    <div id="bottom">
        <div class="b_mian">
            <p class="special">
                <span style="line-height:50px;font-size:14px;">客服: <script>writeWechatName()</script></span><b><a
                            href="javascript:;" class="showkefu"
                            style="color:#0085FF;">咨询有礼</a></b> 
                <img src="/static/pageres/wechat-web/tb2aiddxwzef1jjszftxxau2fxa-2145885388.png?=<?php echo $v ?>" data-agl-cvt="35" id="btn" /></p>
            <div style="clear:both"></div>
        </div>
    </div>
    
    <?php if($data['fields']['company_name']): ?>
    <div class="banquan"><?php echo $data['fields']['company_name']; ?></div>
    <?php endif; ?>
    
    <script type="text/javascript">
        function copyArticle99(event) {
            const range = document.createRange();
            range.selectNode(document.getElementById('article'));
    
            const selection = window.getSelection();
            if (selection.rangeCount > 0) selection.removeAllRanges();
            selection.addRange(range);
            // setTimeout(function () {
            //     $('.bg').show();
            //     $('#showbox').show();
            // }, 1000)
            document.execCommand('copy');
            alert("已复制好，可打开微信粘贴添加客服。");
        }
    
        document.getElementById('copy').addEventListener('click', copyArticle99, false);
    </script>
    
    <script type="text/javascript">
        //防止页面后退
        // history.pushState(null, null, document.URL);
        // window.addEventListener('popstate', function () {
        //     // $('.bg').show();
        //     // $('#showbox').show();
        //     history.pushState(null, null, document.URL);
        // });
        
        /*点击复制微信号*/
        function copywx() {
            const range = document.createRange();
            range.selectNode(document.getElementById('copy_content'));
            const selection = window.getSelection();
            if (selection.rangeCount > 0) selection.removeAllRanges();
            selection.addRange(range);
            document.execCommand('copy');
            alert("复制成功！");
        }
    
        /*点击出现弹框*/
        function showwx() {
            var ss = document.getElementById('myshow');
            ss.style.display = 'block';
        }
    
        /*关闭弹窗*/
        function closeshow() {
            var ss = document.getElementById('myshow');
            ss.style.display = 'none';
        }
    </script>
    
    <script type="text/javascript">
    
        $('#btn,.showkefu').click(function () {
            copyArticle99();
        })
    
        $('#closebox').click(function () {
            $('.bg').hide();
            $('#showbox').hide();
        })
    
    </script>
    
    <?php echo $data['bottom_html'] ?>
</body>
</html>


